Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Hyperlane AVS contracts #3651

Merged
merged 38 commits into from
May 9, 2024
Merged

feat: Hyperlane AVS contracts #3651

merged 38 commits into from
May 9, 2024

Conversation

aroralanuk
Copy link
Contributor

@aroralanuk aroralanuk commented Apr 22, 2024

Description

  • Implements IServiceManager for the ECDSAServiceManagerBase which has a single quorum
  • HyperlaneServiceManager (HSM), the main AVS contract for registering/deregistering operators and enrolling/unenrolling into challengers
  • the HSM has a mutable slasher so that once the EL slasher is live, we can set it for your AVS too to enable freezing operators.
  • EnumerableMapEnrollment for a enumerable map of enrollment statuses for each operator and challenger

Update: I switched the ECDSAServiceManager i had written earlier to steven's PR here: Layr-Labs/eigenlayer-middleware#234. The differences are:

  • events for (de)registering

Notes

  • hardhat yarn tries looking for all imports (including the ones from submodules) as npm libraries , eg. @eigenlayer/core.
  • add optIntoSlashing into HSM?

Drive-by changes

  • none

Related issues

Backward compatibility

Testing

Copy link

changeset-bot bot commented Apr 22, 2024

⚠️ No Changeset found

Latest commit: 13f6da8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

solidity/remappings.txt Outdated Show resolved Hide resolved
@aroralanuk aroralanuk marked this pull request as ready for review April 26, 2024 12:57
Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didnt look at tests yet
please fix the build, obviously that will block deployment

solidity/contracts/test/ERC4626/ERC4626Test.sol Outdated Show resolved Hide resolved
solidity/contracts/libs/EnumerableMapEnrollment.sol Outdated Show resolved Hide resolved
solidity/contracts/Mailbox.sol Outdated Show resolved Hide resolved
solidity/contracts/avs/ECDSAServiceManagerBase.sol Outdated Show resolved Hide resolved
solidity/contracts/avs/HyperlaneServiceManager.sol Outdated Show resolved Hide resolved
solidity/contracts/avs/HyperlaneServiceManager.sol Outdated Show resolved Hide resolved
solidity/remappings.txt Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 42.56055% with 166 lines in your changes are missing coverage. Please review.

Project coverage is 68.35%. Comparing base (5d96847) to head (13f6da8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3651      +/-   ##
==========================================
- Coverage   74.42%   68.35%   -6.08%     
==========================================
  Files         110      122      +12     
  Lines        1228     1517     +289     
  Branches      133      162      +29     
==========================================
+ Hits          914     1037     +123     
- Misses        297      452     +155     
- Partials       17       28      +11     
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 69.94% <ø> (ø)
isms 73.17% <ø> (ø)
token 65.41% <ø> (+0.75%) ⬆️
middlewares 77.05% <ø> (-0.44%) ⬇️

Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few more small notes
can you test the deploy script in CI easily?

solidity/contracts/avs/ECDSAStakeRegistry.sol Show resolved Hide resolved
solidity/contracts/avs/HyperlaneServiceManager.sol Outdated Show resolved Hide resolved
solidity/script/DeployAVS.s.sol Outdated Show resolved Hide resolved
solidity/script/DeployAVS.s.sol Outdated Show resolved Hide resolved
solidity/test/avs/HyperlaneServiceManager.t.sol Outdated Show resolved Hide resolved
solidity/test/avs/HyperlaneServiceManager.t.sol Outdated Show resolved Hide resolved
Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry will need one more round of review and a bit closer look at your tests before approval

Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

solidity/script/avs/DeployAVS.s.sol Show resolved Hide resolved
solidity/script/avs/DeployAVS.s.sol Outdated Show resolved Hide resolved
solidity/script/avs/DeployAVS.s.sol Show resolved Hide resolved
solidity/script/avs/DeployAVS.s.sol Show resolved Hide resolved
solidity/script/avs/eigenlayer_addresses.json Outdated Show resolved Hide resolved
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slither found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@aroralanuk aroralanuk enabled auto-merge (squash) May 9, 2024 16:56
@aroralanuk aroralanuk merged commit 76619d0 into main May 9, 2024
33 of 37 checks passed
@aroralanuk aroralanuk deleted the kunal/avs-contracts branch May 9, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

HyperlaneServiceManager
2 participants